home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Devices / Qwertytunes / BigEasy2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-03  |  6.3 KB  |  226 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        BigEasy2.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    xxx put writers here xxx
  7.  
  8.     Copyright:    © 1990-1992 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     This file is used in these builds: Warhol
  11.  
  12.     Change History (most recent first):
  13.  
  14.         <18>      1/7/93    dvb        Built in window-copy command.
  15.         <17>     4/13/92    dvb        Pass activate/deactivates to back windows.
  16.         <16>     3/22/92    dvb        QuitApp message.
  17.         <15>     1/20/92    dvb        Cool new features. Easier AppleEvents.
  18.         <14>    12/19/91    JB        removing think 4.0 code
  19.         <13>     8/25/91    JB        Changed #def Ticks to #def GetTicks
  20.         <12>      6/3/91    dvb        Just hackin.
  21.         <11>     5/28/91    JB        Added prototypes for BigEasy Proc Ptrs
  22.         <10>     5/25/91    JB        OLD_THINK_C && TOOLBOX_LINKED
  23.          <9>     5/23/91    PH        functions..
  24.          <8>      5/5/91    dvb        App Open Events
  25.          <7>     4/25/91    JB        Changing to new THINK C interface files
  26.          <6>     4/19/91    dvb        Add WindowEventProc
  27.          <5>     2/24/91    dvb        Various cool new calls
  28.          <4>     2/18/91    dvb        Miscellaneous Updates
  29.          <3>      2/6/91    JB        Made nil #define conditional
  30.          <2>    11/17/90    dvb        Remove subport machinery
  31.          <4>     9/19/90    dvb        Fix graphics math collision
  32.          <3>     9/10/90    dvb        Take Zoomproc out of InstallWindow call.
  33.          <2>     7/31/90    dvb        Modify inclusion hierarchy
  34.  
  35.     To Do:
  36. */
  37.  
  38. /* file: BigEasy2.h
  39.  *
  40.  * Started 4 July 1989, more or less.
  41.  *
  42.  * A set of routines to allow the quick development
  43.  * of simple Macintosh applications.
  44.  *
  45.  */
  46.  
  47. #ifndef BigEasyIncludes
  48. #define BigEasyIncludes
  49.  
  50. #include <Types.h>
  51. #include <Menus.h>
  52. #include <Events.h>
  53. #include <Files.h>
  54.  
  55. /************************************
  56. * Simple things
  57. ************************************/
  58.  
  59. typedef void (*beUpdateProcPtr)(short windowNum);        
  60. typedef void (*beClickProcPtr)(short windowNum, Point p, short modifiers);        
  61. typedef void (*beKeyProcPtr)(short windowNum, short key, short keycode, short modifiers);        
  62. typedef void (*beGoAwayProcPtr)(short windowNum);        
  63. typedef void (*beActivateProcPtr)(short windowNum);        
  64. typedef void (*beDeactivateProcPtr)(short windowNum);        
  65. typedef void (*beIdleProcPtr)(short windowNum, Boolean upfront);        
  66. typedef void (*beResizeProcPtr)(short windowNum, Point *oldSize, Point *newSize, short modifiers);        
  67. typedef void (*beGrowWindowProcPtr)(long *newSize, short windowNum,
  68.                         WindowPtr w, Point where, Rect *resizeLim);        
  69. typedef void (*beEventProcPtr)(short windowNum, EventRecord *event, Boolean *tookEvent);    
  70. typedef void (*beMoveWindowProcPtr)(short windowNum);    
  71. typedef void (*beMenuProcPtr)(short windowNum, short menuItem, short menuRef);
  72.  
  73. typedef void (*beAboutProcPtr)(void);        
  74. typedef void (*beWNumCallProcPtr)(short windowNum);
  75.  
  76. typedef void (*beOpenAppProcPtr)(void);
  77. typedef void (*beOpenDocProcPtr)(FSSpec *file);
  78. typedef void (*beQuitAppProcPtr)(void);
  79.  
  80.  
  81. #ifndef nil
  82.     #define nil (0L)
  83. #endif
  84.  
  85. #define SwapShort(a,b) {short temp; temp = a; a = b; b = temp;}
  86.  
  87.  
  88. /************************************
  89. * Types
  90. ************************************/
  91.  
  92. /*
  93.   * Window Flags (as passed to InstallWindow)
  94.   */
  95. typedef enum
  96.     {
  97.     wGrowable = 1,
  98.     wZoomable = 2,
  99.     wCoolDrag = 4,                /* Set to do the really cool live-dragwindow trick */
  100.     wCopyDraw = 8                /* Enables Copy edit item, and uses DrawDoc to do it. */
  101.     };
  102.  
  103. /*
  104.  * Built in menu ref-numbers
  105.  */
  106. typedef enum
  107.     {
  108.     mUndo = 30000,
  109.     mCut,
  110.     mCopy,
  111.     mPaste,
  112.     mClear
  113.     };
  114.  
  115. /************************************
  116. * BigEasy2 Public Global Variables
  117. ************************************/
  118. #ifdef BigEasy2
  119.     #define VAR
  120. #else
  121.     #define VAR extern
  122. #endif
  123.  
  124. VAR Boolean gQuitApp;
  125. VAR Boolean gMenuNeedsCmdKey;
  126. VAR Boolean gStaggerWindows;
  127. VAR Boolean gWindowsInView;
  128. VAR short gLastModifiers;
  129. VAR long gLastEventTime;
  130.  
  131. VAR long gSystemVersion;        /* for app to read */
  132. VAR Boolean gHasAppleEvents;    /* for app interest */
  133. VAR Boolean gHasColor;            /* for app interest */
  134.  
  135. VAR Rect gBigRect;
  136.  
  137. #ifndef __QUICKDRAW__
  138.     #include <QuickDraw.h>
  139. #endif
  140.  
  141. #ifndef __WINDOWS__
  142.     #include <Windows.h>
  143. #endif
  144.  
  145. #undef VAR
  146.  
  147.  
  148. /************************************
  149. * Major BigEasy2 Routines
  150. ************************************/
  151.  
  152. WindowPtr InstallWindow(short iNum,StringPtr iTitle,Rect *iRect,short iType,short newFlags,
  153.         beUpdateProcPtr iUpdate,beClickProcPtr iClick,beKeyProcPtr iKey,beGoAwayProcPtr iGoAway,
  154.         beActivateProcPtr iActivate,beDeactivateProcPtr iDeactivate,beIdleProcPtr iIdle);
  155.  
  156. void UninstallWindow(short iNum);
  157.  
  158. Boolean HandleUpdateEvent(EventRecord *er);
  159. Boolean HandleActivateEvent(EventRecord *er);
  160.  
  161.  
  162. void Show(short inum);
  163. void Hide(short iNum);
  164.  
  165. MenuHandle InstallMenu(StringPtr s,beMenuProcPtr action,short ref);
  166. void InstallMenuItem(StringPtr s,beMenuProcPtr action,short ref);
  167. void DeleteMenuItem(short ref);
  168. void SetMenuItem(short ref,char enable,char isMarked,char mark,StringPtr s);
  169. void EnDisEdits(short Eundo,short Ecut,short Ecopy,short Epaste,short Eclear);
  170. void InstallEditMenu(beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr);
  171. void SetCurrentMenu(short ref);
  172. long DisableAllMenus(void);
  173. void EnableAllMenus(long saveMenus);
  174.  
  175. void SetMasterIdle(beAboutProcPtr);
  176. void IdleWindow(short n);
  177.  
  178. void SetMasterOpenAppProc(beOpenAppProcPtr);
  179. void SetMasterOpenDocProc(beOpenDocProcPtr);
  180. void SetMasterQuitAppProc(beQuitAppProcPtr);
  181.  
  182. void SetWindowResizeProc(short n,beResizeProcPtr resizeProc);
  183. void SetWindowGrowWindowProc(short n,beGrowWindowProcPtr growWindowProc);
  184. void SetWindowZoomProc(short n,beWNumCallProcPtr iZoom);
  185. void SetWindowMoveProc(short n,beMoveWindowProcPtr moveWindowProc);
  186. void SetWindowEventProc(short n, beEventProcPtr iEvent);
  187. long GetWindowFlags(short n);
  188. void SetWindowFlags(short n,long flags);
  189.  
  190. void GetWindowRect(short n,Rect *r);
  191. WindowPtr GetWindowPtr(short n);
  192. Boolean GetWindowVisible(short n);
  193. void Replace1Resource(Handle,long type,short id);
  194. void SaveWindowPosition(short n);
  195. void ForgetWindowPosition(short n);
  196.  
  197. void SetAbout(StringPtr progName,StringPtr s0,beAboutProcPtr aboutProc);
  198.  
  199. void GoWatch(void);
  200. void GoArrow(void);
  201. void GoCursor(short c);
  202.  
  203. void FailNil(long);
  204. void FailOSErr(long);
  205.  
  206. /************************************
  207. * Client Provided BigEasy2 Routines
  208. ************************************/
  209.  
  210. void Bootstrap(void);
  211. void Hatstrap(void);
  212.  
  213.  
  214. /************************************
  215. * Minor BigEasy2 Hacks
  216. ************************************/
  217. #ifndef BigEasy2
  218.     #define FailNil(x)    FailNil((long)(x))                    /* Simulate a typeless call            */
  219.     #define FailOSErr(x)    FailOSErr((long)(x))            /* Simulate a typeless call            */
  220. #endif
  221.  
  222. #define GetTicks() (*(long *)Ticks)
  223.  
  224. #endif
  225.  
  226.